package game.players;

import game.players.user.movements.WithoutBallStationaryUser;
import game.soccerField.Arc;

import com.uqbar.vainilla.appearances.Animation;
import com.uqbar.vainilla.appearances.Sprite;

public class SoccerPlayerUser extends SoccerPlayer {
	
	public SoccerPlayerUser(double x, double y) {
		super(x,y);
		this.setState(new WithoutBallStationaryUser(this));
	}
	
	public SoccerPlayerUser(double x, double y, Arc rivalArc) {
		super(x,y);
		this.setRivalArc(rivalArc);
		this.setState(new WithoutBallStationaryUser(this));
	}
	
	public void setRightAnimationWithSpeed(double meanTime) {
		this.setAppearance(new Animation(meanTime,
				Sprite.fromImage("/images/goal3_caminando2.png").crop(47, 0, 34, 65).scale(1.5),
				Sprite.fromImage("/images/goal3_caminando2.png").crop(99, 0, 34, 64).scale(1.5),
				Sprite.fromImage("/images/goal3_caminando2.png").crop(143, 0, 34, 65).scale(1.5),
				Sprite.fromImage("/images/goal3_caminando2.png").crop(193, 1, 34, 65).scale(1.5)
				));
	}
	
	public void setLeftAnimationWithSpeed(double meanTime) {
		this.setAppearance(new Animation(meanTime,
				Sprite.fromImage("/images/goal3_caminando2.png").crop(47, 0, 34, 65).scale(1.5).flipHorizontally(),
				Sprite.fromImage("/images/goal3_caminando2.png").crop(99, 0, 34, 64).scale(1.5).flipHorizontally(),
				Sprite.fromImage("/images/goal3_caminando2.png").crop(143, 0, 34, 65).scale(1.5).flipHorizontally(),
				Sprite.fromImage("/images/goal3_caminando2.png").crop(193, 1, 34, 65).scale(1.5).flipHorizontally()
				));
	}


	@Override
	public boolean isUserMate() {
		return true;
	}


	@Override
	public boolean isGoalKeeper() {
		return false;
	}


	@Override
	public void throwOutTheBall() {
		this.setState(new WithoutBallStationaryUser(this));
	}
	
}
